package com.finance3.springmvc.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.finance3.springmvc.bean.User;
import com.finance3.springmvc.dao.queryUser;
import com.finance3.springmvc.dao.queryUserImple;

public class checkUidServlet extends HttpServlet{
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		//System.out.println("测试是否执行checkUIDServlet方法");
		
		String uid = req.getParameter("uid");
		String msg="";
		if(uid!=null) {
			queryUser userid = new queryUserImple();
			String userByUid = userid.getUserByUid(uid);
			if(userByUid==null) {
				msg="1";
			}
			else {
				msg="0";
			}
		}
		else {
			msg="1";
		}
		resp.setContentType("text/html;utf-8");
		resp.getWriter().println(msg);
	}
}
